﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace TroTro
{
    public class Radio
    {
        #region Fields

        //Sounds
        private Song _f1;
        private Song _f2;
        private Song _f3;
        private Song _f4;
        private Song _f5;
        private Song _f6;

        //String Names
        private string _songName;
        private string _artistName;

        public string SongName { get { return _songName; } }
        public string ArtistName { get { return _artistName; } }

        #endregion

        #region XNA Methods

        public void LoadContent(ContentManager content)
        {
            _f1 = content.Load<Song>(@"Music\Timaya - Love is blind");
            _f2 = content.Load<Song>(@"Music\Timaya - Who Born You");
            _f3 = content.Load<Song>(@"Music\Timaya - If To Say");
            _f4 = content.Load<Song>(@"Music\CRANK DAT SOULJA BOY  by Naija boyz");
            _f5 = content.Load<Song>(@"Music\Run_s T Shake Your");
            _f6 = content.Load<Song>(@"Music\RECORDZ");

            if (MediaPlayer.State == MediaState.Playing)
            {
                MediaPlayer.Stop();
            }
            MediaPlayer.Play(_f1);
            _songName = "Love is blind";
            _artistName = "Timaya";
        }

        public void Update(GameTime gameTime)
        {
            var ks = Keyboard.GetState();

            if (ks.IsKeyDown(Keys.F1))
            {
                if (MediaPlayer.State == MediaState.Playing)
                {
                    MediaPlayer.Stop();
                }
                MediaPlayer.Play(_f1);

                _songName = "Love is blind";
                _artistName = "Timaya";
            }

            if (ks.IsKeyDown(Keys.F2))
            {
                if (MediaPlayer.State == MediaState.Playing)
                {
                    MediaPlayer.Stop();
                }
                MediaPlayer.Play(_f2);

                _songName = "Who Born You";
                _artistName = "Timaya";
            }

            if (ks.IsKeyDown(Keys.F3))
            {
                if (MediaPlayer.State == MediaState.Playing)
                {
                    MediaPlayer.Stop();
                }
                MediaPlayer.Play(_f3);

                _songName = "If To Say";
                _artistName = "Timaya";
            }

            if (ks.IsKeyDown(Keys.F4))
            {
                if (MediaPlayer.State == MediaState.Playing)
                {
                    MediaPlayer.Stop();
                }
                MediaPlayer.Play(_f4);

                _songName = "Crank Dat";
                _artistName = "Naija Boyz";
            }

            if (ks.IsKeyDown(Keys.F5))
            {
                if (MediaPlayer.State == MediaState.Playing)
                {
                    MediaPlayer.Stop();
                }
                MediaPlayer.Play(_f5);

                _songName = "Shake Your Body";
                _artistName = "Run's T";
            }

            if (ks.IsKeyDown(Keys.F6))
            {
                if (MediaPlayer.State == MediaState.Playing)
                {
                    MediaPlayer.Stop();
                }
                MediaPlayer.Play(_f6);

                _songName = "Your Loving";
                _artistName = "Spurz";
            }
        }

        #endregion
    }
}
